Repository navigation
Conversation
The resolver used birpc's default generics, which don't match the RPC's own, so @qwik.dev/mcp failed to typecheck. Our resolver ignores this, so BirpcResolver<unknown> fits every caller.
DevTools and MCP instrument component files and root.tsx before the Qwik optimizer, which takes no input sourcemap. Every inserted line shifted the locations it computes, so data-qwik-inspector (click-to-source) pointed several lines below the element. Insert everything inline so source lines stay where they are.
🦋 Changeset detectedLatest commit: 571796f The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@qwik.dev/core
@qwik.dev/router
@qwik.dev/utils
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
@qwik.dev/devtools
@qwik.dev/mcp
commit: |
This was referenced Oct 4, 2026
maiieul
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description
With
qwikDevtools()orqwikMcp()enabled, Alt+click (click-to-source) opens the editor several lines below the element you clicked. On the MCP SSR fixture the counter button is on line 5 ofroutes/index.tsx, anddata-qwik-inspectorsaysroutes/index.tsx:14:5, past the end of a 10 line file. Without either plugin it says5:5.Both plugins instrument component files (and DevTools also
root.tsx) in apretransform, before the Qwik optimizer: an import at the top,const collecthook = ...at the start of each component, a multi-linecollecthook({...})after every hook, and<QwikDevtools />before</body>. Every one of those added lines. The optimizer computes dev locations from the text it receives and takes no input sourcemap, so returning a sourcemap from the transform wouldn't help here.The fix keeps the instrumentation but never adds a line: the imports go on line 1, the init goes right after the component's
{, eachcollecthook(...)is appended on its hook's line (with a;when the statement relies on ASI), and<QwikDevtools />sits right before</body>. The rule is written next to both transform hooks so it doesn't regress.What it doesn't fix:
{QRLDevlo/hiare byte offsets, so they still move. Getting those right would mean instrumenting after the optimizer, which is a bigger changeThere's also a separate one-line commit fixing the type of the birpc resolver from #9123, which made
@qwik.dev/mcpfail its typecheck.Tests: a unit test checks that both transforms keep every source line on its line number and still parse, and the MCP integration test now asserts
data-qwik-inspectorends withroutes/index.tsx:5:5. That assertion fails on main with14:5.Demo
Alt+click on the same button, before and after. The banner shows the location the editor was asked to open and what is actually on that line.
devtools-click-to-source-lines.mp4
Checklist
pnpm change